package net.adetech.crj.dao;

import net.adetech.crj.entity.DD;
import net.adetech.crj.bean.Option;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface DDMapper {

    @Select("select * from CRJ_DD where DD_NO = #{ddNo} order by DD_ORDER")
    List<DD> getDDListByDDNo(@Param("ddNo")String ddNo);

    @Select("select * from CRJ_DD where DD_NAME = #{ddName} order by DD_ORDER")
    List<DD> getDDListByDDName(@Param("ddName")String ddName);

    @Select("select DD_KEY key,DD_VALUE value from CRJ_DD where DD_NAME = #{ddName} order by DD_ORDER")
    List<Option> getOptionListByDDName(@Param("ddName")String ddName);

}
